<?php /*a:1:{s:92:"D:\phpstudy_pro\WWW\git\DSMall\app\home\view\default\base\editable_page_model\model_add.html";i:1591845925;}*/ ?>
<div class='editable-page-model'>
<form>
    <div class="model-item-list">
    <?php if(is_array($editable_page_model_list) || $editable_page_model_list instanceof \think\Collection || $editable_page_model_list instanceof \think\Paginator): if( count($editable_page_model_list)==0 ) : echo "" ;else: foreach($editable_page_model_list as $key=>$model_item): ?>    
    <label class='model-item-wrapper' data-show="0">
        <div class='model-item' title="<?php echo htmlentities($model_item['editable_page_model_intro']); ?>">
            <div class='model-image' data-action="add" data-id="<?php echo htmlentities($model_item['editable_page_model_id']); ?>"><img src='<?php echo htmlentities(UPLOAD_SITE_URL); ?>/home/common/editable-page-model-<?php if(app('request')->param('type')): ?><?php echo htmlentities(app('request')->param('type')); ?>-<?php endif; ?><?php echo htmlentities($model_item['editable_page_model_id']); ?>.jpg'></div>
            <div class='model-name'><?php echo htmlentities($model_item['editable_page_model_name']); ?></div>
        </div>
    </label>
    <?php endforeach; endif; else: echo "" ;endif; ?>
    </div>
    <div class="clear"></div>
</form>
</div>

<script>
    function submit_model_add(model_id,config_id){
        if(!model_id){
            layer.msg('<?php echo htmlentities(lang('model_id_empty')); ?>')
            return
        }
        addEditableModel(model_id,config_id)
    }
    function show_page(l,p){
        $('.model-item-wrapper').attr('data-show',0)
        $('#current_model_page').text(p)
        for(var i=0;i<l;i++){
            $('.model-item-wrapper').eq(i+(p-1)*4).attr('data-show',1)
        }
    }
    $(function(){
        $('.model-item-wrapper .model-image').draggable({
            connectToSortable: ".edit-mode",
            helper: "clone",
            revert: "invalid",
            scroll:false,
            start:function(event, ui ){
                $('.model-list').removeClass('scroll')
            },
            stop:function(){
                $('.model-list').addClass('scroll')
            }
        })
    })
</script>
